package Chapter6.dao;

import java.util.Date;

import org.hibernate.HibernateException;

import Chapter6.superclass.CompanyBook;

import learnning.dao.base.HibernateDao;

public class BookSuperclassDao extends HibernateDao {
	public void addBook(String name, String addrr, Date date) {
		try {
			begin();
			CompanyBook book = new CompanyBook(addrr, date);
			book.setName(name);
			getSession().save(book);
			commit();
		} catch (HibernateException e) {
			rollback();
			e.printStackTrace();
		}
	}
}
